package technical;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Tania M
 * @version 1.0
 */
public class XmlChannelFeedData extends XmlData {

    private String _baliseTitle = null;
    private String _baliseLink = null;
    private String _baliseDescription = null;
    private String _baliseLanguage = null;
    private String _baliseCopyright = null;
    private String _balisePubDate = null;
    private List<XmlFeedItemsMessageData> _balisesEntries = null;

    /**
     *
     * @param title
     * @param link
     * @param description
     * @param language
     * @param copyright
     * @param pubDate
     */
    public XmlChannelFeedData(String title, String link, String description, String language,
            String copyright, String pubDate) {

        this._balisesEntries = new ArrayList<XmlFeedItemsMessageData>();

        this._baliseTitle = title;
        this._baliseLink = link;
        this._baliseDescription = description;
        this._baliseLanguage = language;
        this._baliseCopyright = copyright;
        this._balisePubDate = pubDate;
    }

    /**
     *
     * @param obj
     */
    public XmlChannelFeedData(XmlChannelFeedData obj) {

        this._balisesEntries = obj.getMessages();

        this._baliseTitle = obj.getTitle();
        this._baliseLink = obj.getLink();
        this._baliseDescription = obj.getDescription();
        this._baliseLanguage = obj.getLanguage();
        this._baliseCopyright = obj.getCopyright();
        this._balisePubDate = obj.getPubDate();
    }

    /**
     *
     * @return
     */
    public List<XmlFeedItemsMessageData> getMessages() {
        return _balisesEntries;
    }

    /**
     *
     * @return
     */
    public String getTitle() {
        return _baliseTitle;
    }

    /**
     *
     * @return
     */
    public String getLink() {
        return _baliseLink;
    }

    /**
     *
     * @return
     */
    public String getDescription() {
        return _baliseDescription;
    }

    /**
     *
     * @return
     */
    public String getLanguage() {
        return _baliseLanguage;
    }

    /**
     *
     * @return
     */
    public String getCopyright() {
        return _baliseCopyright;
    }

    /**
     *
     * @return
     */
    public String getPubDate() {
        return _balisePubDate;
    }

    @Override
    public String toString() {
        return "<canal_COPYRIGHT>" + _baliseCopyright + "</canal_COPYRIGHT><canal_DESCRIPTION>" + _baliseDescription
                + "</canal_DESCRIPTION><canal_LANGUAGE>" + _baliseLanguage + "</canal_LANGUAGE><canal_LINK>"
                + _baliseLink + "</canal_LINK><canal_pubDATE>" + _balisePubDate + "</canal_pubDATE><canal_title>"
                + _baliseTitle + "</canal_title>";
    }

    /**
     * @param balisesEntries the _balisesEntries to set
     */
    public void setMessages(List<XmlFeedItemsMessageData> balisesEntries) {
        this._balisesEntries = balisesEntries;
    }
}
